package com.wang.vedio.adapter.index;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wang.vedio.R;
import com.wang.vedio.net.entity.InviteBean;

import java.util.List;

/**
 * 推荐-最新 适配器
 *
 *
 * @time 2020/4/7
 */
public class InviteAdapter extends BaseQuickAdapter<InviteBean, BaseViewHolder> {
    public InviteAdapter(int layoutResId, @Nullable List<InviteBean> data) {
        super(layoutResId, data);
    }

    private int selectPosition = -1;
    public void setSelectPosition(int position){
        this.selectPosition = position;
        notifyDataSetChanged();
    }

    @Override
    protected void convert(BaseViewHolder helper, InviteBean item) {
        helper.setText(R.id.ddjeTv, "+"+item.getHuoDeMoney()+"元")
        .setText(R.id.yqrsTv,"邀请"+ item.getInviteNumber()+"人")
        .setText(R.id.vipDayTv,"奖励VIP会员"+(Integer.parseInt(item.getVipDay())>10000?"永久":item.getVipDay()+"天"));


    }
}
